
const paths = {
  top: 'M0,75h569L643,0h4L637,12H1920v8H646L589,78H0Z',
  bottom: 'M0,1060h1510l60-60H1920v8H1586l-73,73h-5l13-13H0Z',

  topPanel: 'M0,76h570l64-64H1920V0H0Z',
  bottomPanel: 'M0,1066h1526l60-60H1920V1080H0Z',

  topBar: 'M0,0h128l-8,8h-128Z',

  // "接下来" 三个字和 "NEXT"
  nextChJie: 'M1,61L0,57h10l4-17l-10,2l1-5l10-2L21,16h-9.5l1.2-4.5h9.4l3-10.7h11.5l-3,10.7h8.2L38.6,16h-6l-4.6,17.2l8-1.6l-1.4,5l-8,1.6l-6.2,23H.9z'
    + 'M99.3,5.7L95.6,10H45l1-4.3H67L68.6,0H80l-1.5,5.7H99.3z'
    + 'M95.5,20l-4,4H41l1.2-4.3h4.3L46,12.3h11.4L58,20h22.5l5-7.7h11.4L92,20H95.5z'
    + 'M60,53.7l-28.6,7.6l1.8-6.7l15.3-4.5l-10.6-3.3l.3-.6l5-11.3h-4.7l1-4.3h5.4l2-4.5h9.7l-2,4.5h38l-4,4.4h-2l-1,12l-12.4,3.3l13,4.5l-2,7L60,53.7z'
    + 'M62,46l14.7-4.3v-7H52.5l-3,7L62,46z',
  nextChXia: 'M29.4,4.3H0L1,0H83l-4,4.3H41l-2.5,9.5h11.4L70,48.2H56L37.4,17L25.6,61H14L29.4,4.3z',
  nextChLai: 'M73,35.5l11,26H71l-11-26h-6l-7,26H35.3l7-26h-5l-25,26H0l25-26H9.3l1.3-4.7h18l-8-19.4h12.6'
    + 'L41,30.8h2.5L49.6,8h-33l1.3-4.7h33L52,0h12l-1,3.3h35L94,8H61.5l-6,23h4l18.3-19.5h12.6L72,31h18.4l-3.5,5H73z',
};

const colors = {
  uiMain: '#f4ac00', // 橙黄色 f4ac00
  uiSub: '#fd2293', // 粉色 fd2293
  uiMainD1: '#bd7e1d',
  
  textMain: '#ffde00', // 黄色
  textSub: '#ffa0e8', // 粉色

  bgNormal: '#5f2d5d',
  bgD1: '#44273c',
  bgL1: '#894388',
  bgL2: '#d181af',
};

const assets = {
  fontFunc: {
    FangZheng: (context) => context.commonAssetPath('fonts/fangzheng.ttf'),
  },
};

const layouts = {
  global: {
    width: 1920, height: 1080,
  },
  bg: {
    top: {
      barX: 35,
      barY: 63,
      barOffX: 131,
    },
  },
  header: {
    x: 110, y: 160,
  },
  contents: {
    x: 150, y: 280,
    programme: {
      height: 80,
      bgX: 2, bgY: 2,
      bgWidth: 1200, bgHeight: 76,
      bgCorner: 10,

      prefixFont: 44,
      prefixOffX: 48,
      prefixMarginRight: 72,

      titleFont: 36,
      titleMarginRight: 72,

      subtitleFont: 20,
      subtitleMargin: 24,

      suffixFont: 32,
      suffixMargin: 16,
      suffixSplitFont: 40,
    }
  }
};

/**
 * @param {string} name
 * @returns {Promise}
 */
function loadFont(name, context) {
  const path = assets.fontFunc[name](context);
	const font = new window.FontFace(name, `url(${path})`);
	document.fonts.add(font);
	return font.load();
}

export {
  assets, colors, paths, layouts,
  loadFont,
};
